﻿using System;
using Hicap.AuthorizationServer.Core.Common;

namespace Hicap.AuthorizationServer.Core.Identity
{
    public class AuthObjectHelper
    {
        public static string ConvertActionNameToAuthObject(string actionName)
        {
            if (actionName.Contains(ActionEnum.Delete.ToString())) return ActionEnum.Delete.ToString();

            if (actionName.Contains(ActionEnum.Insert.ToString())) return ActionEnum.Upsert.ToString();

            if (actionName.Contains(ActionEnum.Import.ToString())) return ActionEnum.Upsert.ToString();

            if (actionName.Contains(ActionEnum.Download.ToString())) return String.Empty;

            return String.Empty;
        }
    }
}